//
//  YHDrawimageVC.m
//  LyhToolsTest
//
//  Created by LYH on 2019/2/26.
//  Copyright © 2019 LYH.com. All rights reserved.
//

#import "YHDrawImageVC.h"
#import "YHDrawview.h"
@interface YHDrawImageVC ()
@property (nonatomic, strong) UIButton *DrawTriangleBtn;//绘制三角形Btn
@end

@implementation YHDrawImageVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initnava];
    [self initUI];
    
}
- (void)initnava
{
    WeakSelf;
    wself.ts_navgationBar = [TSNavigationBar navWithTitle:@"绘制图形" backAction:^{
        [wself.navigationController popViewControllerAnimated:YES];
    }];
}
- (void)initUI
{
    [self DrawTriangleBtn];

}


//绘制
- (void)DrawTriangleClick
{

    YHDrawview *drawview = [[YHDrawview alloc]initWithFrame:CGRectMake(0, SafeAreaTopHeight+50, kScreenWidth, kScreenHeigth-SafeAreaTopHeight-50)];
    
    [self.view addSubview:drawview];
    
    
}

#pragma -mark ————————————————————Lay————————————————————

- (UIButton *)DrawTriangleBtn
{
    if (!_DrawTriangleBtn) {
        _DrawTriangleBtn = [[UIButton alloc]initWithFrame:CGRectMake(25, SafeAreaTopHeight, 80, 35)];
        _DrawTriangleBtn.title = @"绘制三角形";
        _DrawTriangleBtn.titleFont = 15;
        _DrawTriangleBtn.titleColor = [UIColor whiteColor];
        [_DrawTriangleBtn setBackgroundColor:[UIColor lightGrayColor]];
        [self.view addSubview:_DrawTriangleBtn];
        [_DrawTriangleBtn addTarget:self action:@selector(DrawTriangleClick)];
    }
    return _DrawTriangleBtn;
}
@end
